package com.xzh.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xzh.dao.SchedulesMapper;
import com.xzh.model.Schedules;
import com.xzh.model.search.ScheduleDao;
import com.xzh.service.SchedulesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SchedulesServiceImpl implements SchedulesService {
    private SchedulesMapper schedulesMapper;
    @Autowired
    public void setSchedulesMapper(SchedulesMapper schedulesMapper){
        this.schedulesMapper = schedulesMapper;
    }
    @Override
    public Page<Schedules> selectAll(Page<Schedules> page, Schedules schedules) {
        return schedulesMapper.selectAll(page, schedules);
    }

    @Override
    public boolean save(Schedules schedules) {
        return schedulesMapper.insert(schedules) > 0;
    }

    @Override
    public int removeByIds(List<Integer> ids) {
        return schedulesMapper.deleteByIds(ids);
    }

    @Override
    public boolean updateById(Schedules schedules) {
        return schedulesMapper.updateById(schedules) > 0;
    }

    @Override
    public List<ScheduleDao> selsectList() {
        return schedulesMapper.selsectList();
    }

}
